<template>
  <div id="app">
    <!-- tag:默认是a标签，把标签渲染成button标签 -->
    <!-- replace：把history.push，改成replace -->
    <!-- active-class：修改默认的button按钮激活名称    通常不会做修改-->
    <router-link to="/Home" tag="button" replace active-class="active">首页</router-link>
    <router-link to="/About" tag="button" replace active-class="active">关于</router-link>
    <button @click="btnClick">代码跳转</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods:{
    btnClick(){
      this.$router.replace("/Home")
    }
  }
}
</script>

<style scoped>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.active{
  color:#f00
}
</style>
